<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <!--    <h:body>-->
    <ui:composition template="layout.xhtml">-->

        <ui:define name="corpo">
            <h:form id="index_form" acceptcharset="utf-8"> 
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('indexProtocolo.xhtml')}" value="Protocolo" update="@form" immediate="true"/> >
                    <p:commandLink  value="Pagamentos" update="@form" immediate="true"/>
                </div>
                <p:panel header="Principal - Pagamentos">
                    <h:panelGrid style="float: right;" columns="4">
                        <p:graphicImage url="/media/img/new.png" title="Cadastrar Pagamento" /> <p:commandLink   value="Cadastrar" title="Cadastrar Pagamento" actionListener="#{managerPagamento.redirect('criarPagamento.xhtml')}" update="@form"/>
                        <p:graphicImage url="/media/img/search.png" title="Pesquisar Tipo Selo"/><p:commandLink value="Pesquisar" title="Pesquisar Pagamento" actionListener="#{managerConsultarPagamento.redirect('buscarPagamento.xhtml')}" update="@form"/>
                    </h:panelGrid>
                    <br/>
                    <br/>
                    <p:dataTable id="pagamentoTable" var="pag" value="#{managerVisualizarPagamento.pagamentos}" 
                                 paginator="true" rows="5"
                                 paginatorPosition="bottom"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                 rowsPerPageTemplate="5,10,15"
                                 emptyMessage="Nenhuma Pagamento Encontrado">    

                        <f:facet name="header">  
                            Pagamentos
                        </f:facet>

                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Titulo
                            </f:facet>  
                            <h:outputText value="#{pag.titulo}"  />  
                        </p:column>
                        
                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Interessado
                            </f:facet>  
                            <h:outputText value="#{pag.interessado}"  />  
                        </p:column>
                        
                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Descricao
                            </f:facet>  
                            <h:outputText value="#{pag.descricao}"  />  
                        </p:column>
                        
                        <p:column style="width:300px;">  
                            <f:facet name="header" >   
                                Executante
                            </f:facet>  
                            <h:outputText value="#{pag.executante.nome}"  />  
                        </p:column>
                        
                        
                        
                        <p:column headerText="Valor R$"  style="width:128px;">  
                            <h:outputText value="#{pag.valor}" styleClass="teste" style="float: right; font-weight: bold" >
                                <f:convertNumber pattern="#,###,##0.00"/>
                            </h:outputText>
                        </p:column>

                        <p:column style="width:100px;">  
                            <f:facet name="header">  
                                <h:outputText value="Opções" />   
                            </f:facet>
                            <p:commandButton  icon="editar" actionListener="#{managerEditarPagamento.redirect('editarPagamento.xhtml', pag)}" update="@form"/> 
                            <p:commandButton  icon="view" actionListener="#{managerVisualizarPagamento.redirect('visualizarPagamento.xhtml', pag)}" update="@form"/>  

                        </p:column>

                    </p:dataTable> 

                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>